function y=demean(y) 
% Demean a Matrix or Vector of observations 
% Observations - Rows, Series- Columns 
    [t,n]=size(y); 
    mu=mean(y);
    e=repmat(mu,t,1);  
    y=y-e; 
